<template>
	<div class="main">
		<div class="top">
			<van-nav-bar
			  title="学生评教"
			  left-text="返回"
			  left-arrow
			  @click-left="onClickLeft"
			/>
		</div>
		<div class="head">
			<div class="NoFinish"><span>评教</span></div>
			<div class="Finish" @click="onClickRight"><span >已评教</span></div>
		</div>
		<div class="content"  v-for="item in PjInfo" v-if="item.numScore==0" >
			<!-- <div class="term"><span>{{item.courseclassState}}</span></div> -->
			<div class="list" @click="toDetail(item.evaluationPaperId)">
				<div class="course">
					<!-- <span style="padding-left: 5px;">{{item.course.courseNo}}</span> -->
					<span style="padding-left: 5px;">{{item.courseName}}</span>
					<div class="isFinish">未评教</div>
				</div>
				<div class="teacher">
					<van-icon class="iconfont icon-jiaoshi"  color="blue"></van-icon>
					<span style="padding-left: 6px;">{{item.teacherRealName}}</span>
				</div>
				<div class="type">
					<van-icon class="iconfont icon-kechengguanli"  color="blue"></van-icon>
					
					<span style="padding-left: 1px;">
						<!-- <template slot-scope="scope"> -->
					        {{ item.courseType == "1" ? '必修课' : '选修课' }}
					    <!-- </template> -->
					</span>
					<!-- <van-icon class="iconfont icon-chengjiguanli"></van-icon> -->
				</div>
				<div class="pichi">
					<van-icon class="iconfont icon-kechengjihua"  color="blue"></van-icon>
					<span style="padding-left: 6	px;">{{item.beginTime}}——{{item.endTime}}</span>
				</div>
				<van-divider :style="{color:'#C0C0C0',borderColor: '#C0C0C0'}" />
			</div>
		</div>
		<div v-else>
			<van-empty description="目前还未有评教!" />
		</div>
	</div>
</template>

<script>
import Vue from 'vue'
import user from '../../store/modules/user'
import {getPjInfo,getEvalTeacherList} from '@/api/pj'
	export default {
		data() {
			return{
				userId:this.$store.getters.userId,
				PjInfo:[],
				activityId:this.$route.query.index,
				evaluationPaperId:null
			}
		},
		created() {
			this.getPj()
		},
		methods:{
			onClickLeft(){
				this.$router.push("/")
			},
			onClickRight(){
				this.$router.push({path:"/Info",query:{index:this.activityId}})
				Vue.prototype.$activityId=this.activityId;
				
			},
			async getPj(){
				const result=await getEvalTeacherList(this.activityId);
				if(result.code==200){
					this.PjInfo=result.data;
					console.log(this.PjInfo)
				}else{
					this.$modal.msgError(result.msg);
				}
			},
			toDetail(evaluationPaperId){
				this.$router.push({path:`/Info/detail`,query:{index: evaluationPaperId,activityId: this.activityId}});
			}
		}
	}
</script>

<style scoped>
	.head{
		background-color: #0099FF;
		display: flex;
		height: 42px;
		
	}
	.head .NoFinish{
		font-size: 24px;
		padding-top: 3px;
		padding-left: 154px;
	}
	.head .Finish{
		padding-top: 5px;
		font-size: 20px;
		padding-left: 100px;
	}
	.term{
		padding: 3px 0 5px 8px;
		font-size: 20px;
	}
	.content .list{
		height: 120px;
		background-color: aliceblue;
	}
	.course{
		display: flex;
		padding-left: 5px;
		font-size: 18px;
	}
	.course .isFinish{
		padding-left: 200px;
		color: firebrick;
	}
	.teacher{
		padding-left: 5px;
		font-size: 18px;
	}
	.type{
		padding-left: 5px;
		font-size: 18px;
	}
	.pichi{
		padding-left: 5px;
		font-size: 18px;
	}
	.content{
		padding-top: 10px;
	}
	.list{
		padding-top: 6px;
	}
</style>